<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SPHinXsys: SPH::BaseMesh Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SPHinXsys
   &#160;<span id="projectnumber">alpha version</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_s_p_h.html">SPH</a></li><li class="navelem"><a class="el" href="class_s_p_h_1_1_base_mesh.html">BaseMesh</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_s_p_h_1_1_base_mesh-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SPH::BaseMesh Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Base class for all structured meshes which may be grid or cell based. The basic properties of the mesh, such as lower bound, grid spacing and number of grid points may be determined by the derived class. Note that there is no mesh-based data defined here.  
 <a href="class_s_p_h_1_1_base_mesh.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="base__mesh_8h_source.html">base_mesh.h</a>&gt;</code></p>

<p>Inherited by <a class="el" href="class_s_p_h_1_1_grid_data_package.html">SPH::GridDataPackage&lt; 4, 6 &gt;</a>, <a class="el" href="class_s_p_h_1_1_grid_data_package.html">SPH::GridDataPackage&lt; PKG_SIZE, ADDRS_SIZE &gt;</a>, and <a class="el" href="class_s_p_h_1_1_mesh.html">SPH::Mesh</a>.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a06e00f3689429e2b174e3da6a7021900"><td class="memItemLeft" align="right" valign="top"><a id="a06e00f3689429e2b174e3da6a7021900"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>BaseMesh</b> (<a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> number_of_grid_points)</td></tr>
<tr class="separator:a06e00f3689429e2b174e3da6a7021900"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5e74d1de7df0fa2a21a35a52298fb4c"><td class="memItemLeft" align="right" valign="top"><a id="ac5e74d1de7df0fa2a21a35a52298fb4c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>BaseMesh</b> (Vecd mesh_lower_bound, Real grid_spacing, <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> number_of_grid_points)</td></tr>
<tr class="separator:ac5e74d1de7df0fa2a21a35a52298fb4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfccde797ba9d7b610933a12c6837768"><td class="memItemLeft" align="right" valign="top"><a id="adfccde797ba9d7b610933a12c6837768"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>BaseMesh</b> (<a class="el" href="class_s_p_h_1_1_base_bounding_box.html">BoundingBox</a> tentative_bounds, Real grid_spacing, <a class="el" href="classsize__t.html">size_t</a> buffer_width)</td></tr>
<tr class="separator:adfccde797ba9d7b610933a12c6837768"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00a3bee5412ec539c8cd068d504cd45b"><td class="memItemLeft" align="right" valign="top"><a id="a00a3bee5412ec539c8cd068d504cd45b"></a>
Vecd&#160;</td><td class="memItemRight" valign="bottom"><b>MeshLowerBound</b> ()</td></tr>
<tr class="separator:a00a3bee5412ec539c8cd068d504cd45b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a075244782af1e6dccff264c569e29dab"><td class="memItemLeft" align="right" valign="top"><a id="a075244782af1e6dccff264c569e29dab"></a>
Real&#160;</td><td class="memItemRight" valign="bottom"><b>GridSpacing</b> ()</td></tr>
<tr class="separator:a075244782af1e6dccff264c569e29dab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6f44b0d0886d0fd8cbbbded978fca8c"><td class="memItemLeft" align="right" valign="top"><a id="ad6f44b0d0886d0fd8cbbbded978fca8c"></a>
<a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a>&#160;</td><td class="memItemRight" valign="bottom"><b>NumberOfGridPoints</b> ()</td></tr>
<tr class="separator:ad6f44b0d0886d0fd8cbbbded978fca8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02486b6eeb392d892833863a6e0c4307"><td class="memItemLeft" align="right" valign="top"><a id="a02486b6eeb392d892833863a6e0c4307"></a>
<a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a>&#160;</td><td class="memItemRight" valign="bottom"><b>NumberOfGridPointsFromNumberOfCells</b> (const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;number_of_cells)</td></tr>
<tr class="separator:a02486b6eeb392d892833863a6e0c4307"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a486a7d7dc1b00d80e3435cb6da248cf2"><td class="memItemLeft" align="right" valign="top"><a id="a486a7d7dc1b00d80e3435cb6da248cf2"></a>
<a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a>&#160;</td><td class="memItemRight" valign="bottom"><b>NumberOfCellsFromNumberOfGridPoints</b> (const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;number_of_grid_points)</td></tr>
<tr class="separator:a486a7d7dc1b00d80e3435cb6da248cf2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fd4caba5139cec4ae745eee2d3cf4ba"><td class="memItemLeft" align="right" valign="top"><a id="a8fd4caba5139cec4ae745eee2d3cf4ba"></a>
Vecd&#160;</td><td class="memItemRight" valign="bottom"><b>GridPositionFromCellPosition</b> (const Vecd &amp;cell_position)</td></tr>
<tr class="separator:a8fd4caba5139cec4ae745eee2d3cf4ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64e9c3be61671675ce2a05751abf99b3"><td class="memItemLeft" align="right" valign="top"><a id="a64e9c3be61671675ce2a05751abf99b3"></a>
<a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a>&#160;</td><td class="memItemRight" valign="bottom"><b>CellIndexFromPosition</b> (const Vecd &amp;position)</td></tr>
<tr class="separator:a64e9c3be61671675ce2a05751abf99b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a521c1c62ca5ceb63b9d03ac81653ed86"><td class="memItemLeft" align="right" valign="top"><a id="a521c1c62ca5ceb63b9d03ac81653ed86"></a>
Vecd&#160;</td><td class="memItemRight" valign="bottom"><b>CellPositionFromIndex</b> (const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;cell_index)</td></tr>
<tr class="separator:a521c1c62ca5ceb63b9d03ac81653ed86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4786bf9f54d35c848819ad006f93bfa"><td class="memItemLeft" align="right" valign="top">Vecd&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_base_mesh.html#ac4786bf9f54d35c848819ad006f93bfa">GridPositionFromIndex</a> (const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;grid_index)</td></tr>
<tr class="separator:ac4786bf9f54d35c848819ad006f93bfa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24c765e7b9960e5dc90ff08e4be8c897"><td class="memItemLeft" align="right" valign="top"><a id="a24c765e7b9960e5dc90ff08e4be8c897"></a>
<a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a>&#160;</td><td class="memItemRight" valign="bottom"><b>transfer1DtoMeshIndex</b> (const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;number_of_mesh_indexes, <a class="el" href="classsize__t.html">size_t</a> i)</td></tr>
<tr class="separator:a24c765e7b9960e5dc90ff08e4be8c897"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0e4e22fec94130d8d25b13b6dfeceee"><td class="memItemLeft" align="right" valign="top"><a id="ae0e4e22fec94130d8d25b13b6dfeceee"></a>
<a class="el" href="classsize__t.html">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><b>transferMeshIndexTo1D</b> (const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;number_of_mesh_indexes, const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;mesh_index)</td></tr>
<tr class="separator:ae0e4e22fec94130d8d25b13b6dfeceee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2b22b19b1175c3e5d8c014e00a1602c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsize__t.html">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_base_mesh.html#ae2b22b19b1175c3e5d8c014e00a1602c">MortonCode</a> (const <a class="el" href="classsize__t.html">size_t</a> &amp;i)</td></tr>
<tr class="separator:ae2b22b19b1175c3e5d8c014e00a1602c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9b5be75a20c93edb12261651fcc0b07"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsize__t.html">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_base_mesh.html#ac9b5be75a20c93edb12261651fcc0b07">transferMeshIndexToMortonOrder</a> (const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;mesh_index)</td></tr>
<tr class="separator:ac9b5be75a20c93edb12261651fcc0b07"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ac8559448b24066e06263bff0aa5ba75b"><td class="memItemLeft" align="right" valign="top">Vecd&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_base_mesh.html#ac8559448b24066e06263bff0aa5ba75b">mesh_lower_bound_</a></td></tr>
<tr class="separator:ac8559448b24066e06263bff0aa5ba75b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6c2e186b771c3573486cdcbaa362b25"><td class="memItemLeft" align="right" valign="top">Real&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_base_mesh.html#af6c2e186b771c3573486cdcbaa362b25">grid_spacing_</a></td></tr>
<tr class="separator:af6c2e186b771c3573486cdcbaa362b25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e1e27e30924c3390d8cdd20dba606fd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_base_mesh.html#a5e1e27e30924c3390d8cdd20dba606fd">number_of_grid_points_</a></td></tr>
<tr class="separator:a5e1e27e30924c3390d8cdd20dba606fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Base class for all structured meshes which may be grid or cell based. The basic properties of the mesh, such as lower bound, grid spacing and number of grid points may be determined by the derived class. Note that there is no mesh-based data defined here. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ac4786bf9f54d35c848819ad006f93bfa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4786bf9f54d35c848819ad006f93bfa">&#9670;&nbsp;</a></span>GridPositionFromIndex()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vecd SPH::BaseMesh::GridPositionFromIndex </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;&#160;</td>
          <td class="paramname"><em>grid_index</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Note that, the lower corner grid of a cell has the same index as the cell. </p>

</div>
</div>
<a id="ae2b22b19b1175c3e5d8c014e00a1602c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2b22b19b1175c3e5d8c014e00a1602c">&#9670;&nbsp;</a></span>MortonCode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsize__t.html">size_t</a> SPH::BaseMesh::MortonCode </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsize__t.html">size_t</a> &amp;&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>converts mesh index into a Morton order. Interleave a 10 bit number in 32 bits, fill one bit and leave the other 2 as zeros <a href="https://stackoverflow.com/questions/18529057/">https://stackoverflow.com/questions/18529057/</a> produce-interleaving-bit-patterns-morton-keys-for-32-bit-64-bit-and-128bit </p>

</div>
</div>
<a id="ac9b5be75a20c93edb12261651fcc0b07"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9b5be75a20c93edb12261651fcc0b07">&#9670;&nbsp;</a></span>transferMeshIndexToMortonOrder()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsize__t.html">size_t</a> SPH::BaseMesh::transferMeshIndexToMortonOrder </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> &amp;&#160;</td>
          <td class="paramname"><em>mesh_index</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function converts mesh index into a Morton order. </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="af6c2e186b771c3573486cdcbaa362b25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af6c2e186b771c3573486cdcbaa362b25">&#9670;&nbsp;</a></span>grid_spacing_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Real SPH::BaseMesh::grid_spacing_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>grid_spacing </p>

</div>
</div>
<a id="ac8559448b24066e06263bff0aa5ba75b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8559448b24066e06263bff0aa5ba75b">&#9670;&nbsp;</a></span>mesh_lower_bound_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Vecd SPH::BaseMesh::mesh_lower_bound_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>mesh lower bound as reference coordinate </p>

</div>
</div>
<a id="a5e1e27e30924c3390d8cdd20dba606fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e1e27e30924c3390d8cdd20dba606fd">&#9670;&nbsp;</a></span>number_of_grid_points_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_s_p_h_1_1_s_vec.html">Vecu</a> SPH::BaseMesh::number_of_grid_points_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>number of grid points by dimension </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>SPHINXsys/src/shared/meshes/<a class="el" href="base__mesh_8h_source.html">base_mesh.h</a></li>
<li>SPHINXsys/src/for_2D_build/meshes/base_mesh_supplementary.cpp</li>
<li>SPHINXsys/src/shared/meshes/<a class="el" href="base__mesh_8cpp.html">base_mesh.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
